<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.kms.model.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String status = request.getAttribute("status1")+"";
MSyspara msapp=new  MSyspara();
MSyspara msdb = new MSyspara() ;
MGroup mg = new MGroup();
if(request.getAttribute("mgroup")!=null){
	mg = (MGroup)request.getAttribute("mgroup");
}

if(mg.getListsyspara()!=null)
	
	for(int j=0;j<mg.getListsyspara().size();j++){
		MSyspara ms = mg.getListsyspara().get(j);
		if("APP".equals(ms.getDatatype())){
			msapp = ms;
		}else{
			msdb = ms;
		}	
	}
%>


<%!
public String Value (Object v)
{
	String rv = "";
	if(v!=null){
		rv = v.toString();
	}
	return rv;
}
%>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
   <title>System Parameter Data</title>
   <link rel="stylesheet" href="<%=basePath %>css/style_master.css" type="text/css">
   <meta http-equiv="cache-control" content="no-cache">
<script type="text/javascript">
function statuss(num){
	document.getElementById("status1").value = num+'editview';
	var form = document.getElementById("thisform");
    form.submit();
}
</script>
</head>
<body>

<table width="100%">
   </table><table>
      <tbody><tr>
         <td><img src="<%=basePath %>img/logo02.gif" alt="JBoss" align="left" border="0"></td>
         <td valign="middle"><h1>System Parameters Setting View</h1></td>
      </tr><tr>
   </tr></tbody></table>
   <ul>
<h3>List of SystemParameterBean attributes:</h3>
</ul>
<hr>
<form id="thisform" method="post" action="systemsetting">
<input id="status1" name="status1" value="<%=status %>" type="hidden" />
<input id="appid" name="appid" value="<%=Value(msapp.getId()) %>" type="hidden" />
<input id="dbid" name="dbid" value="<%=Value(msdb.getId() )%>" type="hidden" />
<input id="mgid" name="mgid" value="<%=Value(mg.getId() )%>" type="hidden" />
<table width="886" border="1" cellpadding="1" cellspacing="1" >
		<tr>
			<td colspan="6" align="left" bgcolor="#FFFFFF"><h3>Monitor Group</h3></td>
		</tr>
		  <tr>
		    <td width="95" align="left" bgcolor="#CCCCCC">MonitorGroup Name</td>
		    <td width="168" align="left"><input name="mname" id="mname" value="<%=Value(mg.getName() )%>" /></td>
		    <td width="92" align="left" bgcolor="#CCCCCC">MonitorGroup CName:</td>
		    <td colspan="3" align="left"><input name="mcname" id="mcname" value="<%=Value(mg.getCname() )%>" /></td>
          </tr>
		<tr>
            <td colspan="6" align="left" bgcolor="#FFFFFF"><h3>APP</h3></td>
		</tr>
		<tr>
		  <td align="left" bgcolor="#CCCCCC">OS IP:</td>
		  <td align="left"><input name="app_osip" id="app_osip" value="<%=Value(msapp.getOsip() )%>" /></td>
		  <td align="left" bgcolor="#CCCCCC">OS Port:</td>
		  <td colspan="3" align="left"><input name="app_osport" id="app_osport" value="<%=Value(msapp.getOsport() )%>" /></td>
    </tr>
		<tr>
		  <td align="left" bgcolor="#CCCCCC">OS User:</td>
		  <td align="left"><input name="app_osuser" id="app_osuser" value="<%=Value(msapp.getOsuser() )%>" /></td>
		  <td align="left" bgcolor="#CCCCCC">OS Password:</td>
		  <td colspan="3" align="left"><input name="app_ospwd" id="app_ospwd" value="<%=Value(msapp.getOspwd() )%>" /></td>
		</tr>
		<tr>
		  <td align="left" bgcolor="#CCCCCC">LogDir:</td>
		  <td colspan="5" align="left"><input name="app_logdir" style="width: 300px" id="app_logdir" value="<%=Value(msapp.getLogdir() )%>" /></td>
    </tr>
		<tr>
		  <td align="left" bgcolor="#CCCCCC">Monitor ServerURL:</td>
		  <td colspan="5" align="left"><input name="app_monitorserverurl" style="width: 300px"  id="app_monitorserverurl" value="<%=Value(msapp.getMonitorserverurl() )%>" /></td>
    </tr>
			<tr>
			  <td colspan="6" align="left" bgcolor="#FFFFFF"><h3>DB</h3></td>
			</tr>
			<tr>
				<td align="left" bgcolor="#CCCCCC">OS IP:</td>
		    	<td align="left"><input name="db_osip" id="db_osip" value="<%=Value(msdb.getOsip() )%>" /></td>
				<td align="left" bgcolor="#CCCCCC">OS Port:</td>
				<td colspan="3" align="left"><input name="db_osport" id="db_osport" value="<%=Value(msdb.getOsport() )%>" /></td>
			</tr>
			<tr>
			  <td align="left" bgcolor="#CCCCCC">OS User:</td>
			  <td align="left"><input name="db_osuser" id="db_osuser" value="<%=Value(msdb.getOsuser() )%>" /></td>
			  <td align="left" bgcolor="#CCCCCC">OS Password:</td>
			  <td colspan="3" align="left"><input name="db_ospwd" id="db_ospwd" value="<%=Value(msdb.getOspwd() )%>" /></td>
    </tr>
			<tr>
			  <td align="left" bgcolor="#CCCCCC">KMS User:</td>
			  <td align="left"><input name="db_kmsuser" id="db_kmsuser" value="<%=Value(msdb.getKmsuser() )%>" /></td>
			  <td align="left" bgcolor="#CCCCCC">KMS Password:</td>
			  <td width="168" align="left"><input name="db_kmspwd" id="db_kmspwd" value="<%=Value(msdb.getKmspwd() )%>" /></td>
			  <td width="92" align="left" bgcolor="#CCCCCC">KMS INSTANCE:</td>
			  <td width="194" align="left"><input name="db_kmsinstance" id="db_kmsinstance" value="<%=Value(msdb.getKmsinstance() )%>" /></td>
    </tr>
			<tr>
			  <td align="left" bgcolor="#CCCCCC">KMS Directory:</td>
			  <td align="left"><input name="db_kmsdirectory" id="db_kmsdirectory" value="<%=Value(msdb.getKmsdirectory() )%>" /></td>
			  <td align="left" bgcolor="#CCCCCC">KMS DirectoryPath:</td>
			  <td colspan="3" align="left"><input name="db_kmsdirectorypath" id="db_kmsdirectorypath" style="width: 300px"  value="<%=Value(msdb.getKmsdirectorypath() )%>" /></td>
    </tr>
			<tr>
				<td align="left" bgcolor="#CCCCCC">BOND User:</td>
		   	 	<td align="left"><input name="db_bonduser" id="db_bonduser" value="<%=Value(msdb.getBonduser() )%>" /></td>
				<td align="left" bgcolor="#CCCCCC">BOND Password:</td>
				<td align="left"><input name="db_bondpwd" id="db_bondpwd" value="<%=Value(msdb.getBondpwd() )%>" /></td>
				<td align="left" bgcolor="#CCCCCC">BOND INSTANCE:</td>
				<td align="left"><input name="db_bandinstance" id="db_bandinstance" value="<%=Value(msdb.getBondinstance() )%>" /></td>
			</tr>
			<tr>
			  <td align="left" bgcolor="#CCCCCC">BOND Directory:</td>
			  <td align="left"><input name="db_bonddirectory" id="db_bonddirectory" value="<%=Value(msdb.getBonddirectory() )%>" /></td>
			  <td align="left" bgcolor="#CCCCCC">BOND DirectoryPath</td>
			  <td colspan="3" align="left"><input name="db_bonddirectorypath" style="width: 300px" id="db_bonddirectorypath" value="<%=Value(msdb.getBonddirectorypath() )%>" /></td>
    </tr>
		</table>
<table width="3" cellpadding="1" cellspacing="1" >
</table>
<table width="886" border="1" cellpadding="1" cellspacing="1" >
  <tr>
    <td colspan="2" align="left" bgcolor="#FFFFFF"><h3>TBS Monitor</h3></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC">OS IP:</td>
    <td align="left"><input name="app_tbsmonitor_osip"  style="width: 300px"  id="app_tbsmonitor_osip" value="<%=Value(msapp.getTbsmonitorosip() )%>" /></td>
    </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC">LogSaveDir:</td>
    <td align="left"><input name="app_logzipdir" style="width: 300px" id="app_logzipdir" value="<%=Value(msapp.getLogzipdir() )%>" /></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC">MonitorLogDir:</td>
    <td align="left"><input name="app_monitorlogdir" style="width: 300px"  id="app_monitorlogdir" value="<%=Value(msapp.getMonitorlogdir() )%>" /></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC">DBZipDir::</td>
    <td align="left"><input name="db_dbzipdir" style="width: 300px" id="db_dbzipdir" value="<%=Value(msdb.getDbzipdir() )%>" /></td>
  </tr>
</table>
<table width="3" border="1" cellpadding="1" cellspacing="1" >
</table>
<br>
	<input value="Apply Changes" type="button" onClick="javascript:statuss('<%=status %>')"/>
</form>
